home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 028a / managr02.zip / SEEFILES.ASI < prev    next >
Text File  |  1991-12-15  |  3KB  |  230 lines

  1. rem Here is the routine for viewing disk files.
  2.  
  3.  
  4. b$=chr$(27)
  5. c$=chr$(13)
  6. d$=chr$(8)
  7. e$=chr$(32)
  8.  
  9. a$=command$
  10. if a$="/40" then seefil40:
  11.  
  12. seefiles:
  13. cls
  14. print "                                View Your Files"
  15. print
  16. print
  17. spaces$=space$(68)
  18. print spaces$;
  19. color 0,7
  20. print "Esc=Quit"
  21. color 7,0
  22. print "Which directory (include drive and path)? ";
  23.  
  24. wait1:
  25. gosub continue:
  26.  
  27. if a$=b$ then
  28. directory$=""
  29. goto menu:
  30. endif
  31.  
  32. if a$=c$ then doview:
  33. gosub cursor:
  34.  
  35. if a$=d$ then
  36. locate a,c
  37. print e$;
  38. locate a,c
  39. d=len(directory$)
  40. e=d-1
  41. directory$=mid$(directory$,1,e)
  42. if e<0 then
  43. e=0
  44. c=c+1
  45. locate a,c
  46. endif
  47. if b=0 then
  48. a=a-1
  49. b=79
  50. locate a,b
  51. print e$;
  52. locate a,b
  53. endif
  54. goto wait1:
  55. endif
  56.  
  57. print a$;
  58. directory$=directory$+a$
  59. goto wait1:
  60.  
  61. doview:
  62. print ""
  63.  
  64. files$=directory$+"\*.*"
  65. attrib=&bin00010000
  66. filename$=find first(files$,attrib)
  67. if error>0 then done:
  68. print filename$
  69.  
  70. loop:
  71. filename$=find continue
  72. if error>0 then done:
  73.  
  74. print filename$
  75.  
  76. file=file+1
  77.  
  78. if file=20 then
  79. print ""
  80. print ""
  81. print "Press any key to continue. ";
  82. gosub continue:
  83. file=0
  84. print
  85. print
  86. endif
  87.  
  88. goto loop:
  89.  
  90. done:
  91. print ""
  92. print ""
  93. print "Press any key to continue. ";
  94. gosub continue:
  95. file=0
  96. directory$=""
  97. print ""
  98. print ""
  99. print "Do you want to see more files? (y/n) ";
  100.  
  101. wait55:
  102. gosub continue:
  103. if a$="y" then seefiles:
  104. if a$="Y" then seefiles:
  105. if a$="n" then menu:
  106. if a$="N" then menu:
  107. goto wait55:
  108.  
  109.  
  110. rem Here is the routine for viewing files in 40-column mode.
  111.  
  112. seefil40:
  113. width 40
  114. print "View Your Files"
  115. print
  116. print
  117. spaces$=space$(30)
  118. print spaces$;
  119. color 0,7
  120. print "Esc=Quit"
  121. color 7,0
  122. print "Which directory (include drive and"
  123. print "path)? ";
  124.  
  125. wait54:
  126. gosub continue:
  127.  
  128. if a$=b$ then
  129. directory$=""
  130. goto menu:
  131. endif
  132.  
  133. if a$=c$ then doview40:
  134. gosub cursor:
  135.  
  136. if a$=d$ then
  137. locate a,c
  138. print e$;
  139. locate a,c
  140. d=len(directory$)
  141. e=d-1
  142. directory$=mid$(directory$,1,e)
  143. if e<0 then
  144. e=0
  145. c=c+1
  146. locate a,c
  147. endif
  148. if b=0 then
  149. a=a-1
  150. b=38
  151. locate a,b
  152. print e$;
  153. locate a,b
  154. endif
  155. goto wait54:
  156. endif
  157.  
  158. print a$;
  159. directory$=directory$+a$
  160. goto wait54:
  161.  
  162. doview40:
  163. print ""
  164. files$=directory$+"\*.*"
  165. attrib=&bin00010000
  166. filename$=find first(files$,attrib)
  167. if error>0 then done40:
  168. print filename$
  169.  
  170. loop40:
  171. filename$=find continue
  172. if error>0 then done40:
  173. print filename$
  174.  
  175. file=file+1
  176.  
  177. if file=20 then
  178. print
  179. print
  180. print "Press any key to continue. ";
  181. gosub continue:
  182. file=0
  183. print
  184. print
  185. endif
  186.  
  187. goto loop40:
  188.  
  189. done40:
  190. print
  191. print
  192. print "Press any key to continue. ";
  193. gosub continue:
  194. file=0
  195. directory$=""
  196. print
  197. print
  198. print "Would you like to view more files? ";
  199.  
  200. wait10:
  201. gosub continue:
  202. if a$="y" then seefil40:
  203. if a$="Y" then seefil40:
  204. if a$="n" then menu:
  205. if a$="N" then menu:
  206. goto wait10:
  207.  
  208. rem This is the end of the routine for viewing files in 40-column mode.
  209.  
  210.  
  211. rem Here is the routine for continuing when the user presses a key.
  212.  
  213. continue:
  214. wait:
  215. a$=inkey$
  216. if a$="" then wait:
  217. return
  218.  
  219.  
  220. rem Here is the routine for fixing the cursor position.
  221.  
  222. cursor:
  223. a=csrlin
  224. b=pos(0)
  225. c=b-1
  226. return
  227.  
  228. menu:
  229. end
  230.